package com.gupao.strategydemo.orderpay.payport;

import com.gupao.strategydemo.orderpay.Payment;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class PayTypeMap {


    public final static String ALI_PAY = "ALI_PAY";
    public final static String WECHAT_PAY = "WECHAT_PAY";
    public final static String UNION_PAY = "UNION_PAY";


    public static Map<String, Payment> paymentMap = new ConcurrentHashMap<>();

    static {
        paymentMap.put(ALI_PAY,new AliPay());
        paymentMap.put(WECHAT_PAY,new WechatPay());
        paymentMap.put(UNION_PAY,new UnionPay());
    }

    public static Payment get(String paymentKey){
        return paymentMap.get(paymentKey);
    }

}
